home *** CD-ROM | disk | FTP | other *** search
/ Power Bytes: Money & Finance / PowerBytes Money and Finance CD-ROM 01 / PowerBytes Money and Finance CD-ROM 01.iso / Utilities / Text Utilities / Text Convert doc < prev    next >
Encoding:
Text File  |  1988-01-31  |  5.4 KB  |  115 lines  |  [TEXT/ttxt]

  1. ==============================================================================
  2.  
  3.             TEXT CONVERT 1.1   January 30, 1988
  4.  
  5. A Public Domain Application/ShareWare Source Code program written in LightSpeed Pascal.
  6.  
  7. The source code of the application can be modified and used like a 'shell' program with many user interface features already present and worked out for the programmer.
  8.  
  9. To obtain the latest version ShareWare source code for this applicaton, written in LightSpeed Pascal send $5, along with a self addressed/stamped envelope and 400K/800K disk to:
  10.  
  11.         Stephen Scandalis
  12.         1414 Prince Edward Way
  13.         Sunnyvale, CA 94087
  14.  
  15. All commercial rights for this application are reserved by the author, but the ShareWare source code may be modified for another application without any further claims from this author.
  16.  
  17. ==============================================================================
  18.  
  19. TEXT CONVERT is a simple application which converts line endings of text file to types required by either the Macintosh or IBM PC computers.
  20.  
  21. It is the outgrowth of needing to transfer text back and forth from my work, where we use MS-DOS machines, to home where of course a Mac sits.
  22.  
  23. It has also been the method by which I have learned much about programming the Macintosh computer.
  24.  
  25. The text editors for several MS-DOS editors require either a CR/LF or just LF line ending.  WIth one particular editor I use, DFEdit, the lack of a LF results in a file which cannot be edited.  When the file is opened only the last line shows.
  26.  
  27. The Mac, on the other hand, doesn't like to see LF characters.  If it does you end up seeing a 'ยท' on the screen.
  28.  
  29. Below is a chart of the line endings each machine requires.
  30.  
  31.             ALLOWED INPUT        OUTPUT
  32.  
  33. Macintosh        CR only            CR only
  34. IBM            CR & LF         CR & LF
  35.                or               or   
  36.             LF only            LF only
  37.  
  38. As can been seen you need to convert the line endings to sucessfully use text files from one machine to another, therefore TEXT CONVERT.
  39.  
  40. ==============================================================================
  41.  
  42. Much more important than the application is the experience this program has provided for learning how to program the Mac.
  43.  
  44. With the fully commented source code I've provided for many of the difficult to learn features of programming the Macintosh.  A partial list is given below:
  45.  
  46. 1) Using UNITS in LightSpeed Pascal to break the code into modules.  Smaller
  47.    modules are easier to maintain.  The present program is broken into 4 UNITS   
  48.    and uses a 'resource' file to hold menu, dialog and alter information.
  49.  
  50. 2) Segmentation of code in LightSpeed Pascal to allow for larger programs than
  51.    32K.  Within the LightSpeed environment the application much be split into
  52.    two segments to run.
  53.  
  54. 3) Growing, Zooming and moving a window.
  55.  
  56. 4) Multiple window management.
  57.  
  58. 5) Saving a picture of QuickDraw commands for a drawing window, so the system
  59.    will automatically update the window's picture when resized or obscured by a
  60.    dialog or alert box.
  61.  
  62.    Utilities included are:
  63.  
  64.      procedure StartPic;      {start saving QuickDraw format of window into a                  picture}
  65.      procedure StopPic;        {stop saving into a picture record}
  66.      procedure SuspendPic;    {temporarily suspend picture copying}
  67.      procedure ResumePic;    {resume recording of QuickDraw commands into                      picture}
  68.  
  69.  
  70. 6) Use of a 'resource file' to define menus, dialogs and alerts.
  71.  
  72. 7) How to open dialogs and alerts in an application.
  73.  
  74. 8) How to use an application specific menu to activate the application's         
  75.    functions.
  76.  
  77. 9) How to select a file name from an HFS volume to perform an action on it.
  78.  
  79. 10) How to read and write from TEXT files.
  80.  
  81. 11) How to use different cursors within your application and how to determine
  82.     when to change the cursor to another one based on the cursor position in 
  83.     the window.
  84.  
  85. 12) How to properly enable and disable MENU items in different parts of the
  86.     application.
  87.  
  88. 13) How to activate DAs and allow them to run on top of the application.
  89.  
  90. ============================================================================
  91.             VERSION 1.1 ENHANCEMENTS
  92. ============================================================================
  93.  
  94. 1) Scroll area of each window is now erased, outlined and grow box drawn
  95.    when windows are moved, grown, zoomed covered by another window or covered
  96.    by dialog and alert boxes.
  97.  
  98. 2) When DAs are opened, this program first checks the available heap space.  
  99.    If there isn't an area the size of the DA + 3K for the DA heap usage an 
  100.    alert box is opened informing the user that there isn't enough memory to
  101.    open the DA.  This assumes that DAs only require 3K of heap space for
  102.    themselves, as indicated is the norm by "Inside Mac".
  103.  
  104. 3) Memory management has been improved considerably, Version 1.0 had a few 
  105.    potential problems. 
  106.  
  107. ============================================================================
  108.  
  109. I hope you find the application usefull.  Contact me at the above address to purchase the ShareWare source code in LightSpeed Pascal.  
  110.  
  111. Armed with this source code a begining programmer should be able to strip 'Text Convert' specific code out and insert their own application specific code.  As an example of the amount of code needed to actually do the text conversion, only about 100-200 lines of code and comments are actually devoted to conversion, the rest of the approximately 2000 lines of code implements the Macintosh user interface.
  112.  
  113. Happy Macing!
  114.  
  115. Steve Scandalis